function gridviewCode(cache) {
    cache.children.sort((a, b) => a.data.y - b.data.y);
    let columnCount = 0;

    let first = cache.children[0];
    let mainAxisSpacing, crossAxisSpacing;
    for (var i = 1; i < cache.children.length; i++) {
        var child = cache.children[i];
        if (first.data.y == child.data.y) {
            columnCount++;
            crossAxisSpacing = child.data.x - first.data.x - first.data.width;
        } else {
            mainAxisSpacing = child.data.y - first.data.y - first.data.height;
            break;
        }
        first = child;
    }


    let childCode = doExport(first);

    let code = `
    GridView.builder(
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: ${columnCount},
        mainAxisSpacing: ${mainAxisSpacing},
        crossAxisSpacing: ${crossAxisSpacing},
      ),
      itemCount: 0,
      itemBuilder: (BuildContext context, int index) {
        return ${childCode};
      },
    )`;
    return code;
}